import 'package:flutter/material.dart';

class Profile extends StatefulWidget {
  const Profile({super.key});

  @override
  State<Profile> createState() => _ProfileState();
}

class _ProfileState extends State<Profile> {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    return Scaffold(
      extendBodyBehindAppBar: true,
      appBar: AppBar(
        actions: [
          Image.asset('assets/appbarsetting.png'),
          const Padding(padding: EdgeInsets.all(10)),
        ],
        leadingWidth: 100,
        leading: const Center(
          child: Text(
            'Proflile',
            style: TextStyle(color: Colors.white, fontSize: 16),
          ),
        ),
        backgroundColor: Colors.transparent,
      ),
      body: Column(
        children: [
          Container(
            height: size.height / 2.4,
            width: size.width,
            padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
            decoration: const BoxDecoration(
              gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [
                    Color(0xffFFBCA6),
                    Color(0xffFF876B),
                  ]),
              image: DecorationImage(
                alignment: Alignment.topCenter,
                fit: BoxFit.cover,
                scale: 3,
                image: AssetImage('assets/ProfileBackimage.png'),
              ),
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                const SizedBox(
                  height: 80,
                ),
                const Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      'Brenda Edwards',
                      style: TextStyle(color: Colors.white, fontSize: 28),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      'Beautician',
                      style: TextStyle(color: Colors.white, fontSize: 12),
                    ),
                  ],
                ),
                const Row(
                  children: [
                    Profilebottom(
                      colortext: Color(0xffFF876B),
                      text: 'Follow',
                      color: Colors.white,
                    ),
                    SizedBox(
                      width: 15,
                    ),
                    Profilebottom(
                      colortext: Colors.white,
                      text: 'Message',
                      color: Colors.transparent,
                    )
                  ],
                ),
                Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 20),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      const Profiledatas(
                        text: '136',
                        title: 'Images',
                      ),
                      Container(
                        width: 1,
                        height: 35,
                        color: Colors.white,
                      ),
                      const Profiledatas(
                        text: '531',
                        title: 'Followers',
                      ),
                      Container(
                        width: 1,
                        height: 35,
                        color: Colors.white,
                      ),
                      const Profiledatas(
                        text: '1302',
                        title: 'Rank',
                      )
                    ],
                  ),
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}

class Profiledatas extends StatelessWidget {
  final String text;
  final String title;
  const Profiledatas({
    super.key,
    required this.text,
    required this.title,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          title,
          style: const TextStyle(
            color: Colors.white,
            fontSize: 12,
          ),
        ),
        Text(
          text,
          style: const TextStyle(color: Colors.white, fontSize: 20, height: 1),
        ),
      ],
    );
  }
}

class Profilebottom extends StatelessWidget {
  final String text;
  final Color color;
  final Color colortext;
  const Profilebottom({
    super.key,
    required this.text,
    required this.color,
    required this.colortext,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 130,
      height: 45,
      decoration: BoxDecoration(
          color: color,
          borderRadius: BorderRadius.circular(5),
          border: Border.all(color: Colors.white)),
      child: Center(
        child: Text(
          text,
          style: TextStyle(color: colortext, fontSize: 16),
        ),
      ),
    );
  }
}
// #
// FFBCA6
